/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package UI;

import static UI.MainInterface.deviceManager;
import static UI.MainInterface.memory;
import static UI.MainInterface.pct;
import static java.lang.Thread.sleep;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class Time implements Runnable{

    int currentTime=0;
    
    public Time(){
    }
    
    @Override
    public void run() {
        while(true){
        try {
            sleep(1000);
        } catch (InterruptedException ex) {
            Logger.getLogger(Time.class.getName()).log(Level.SEVERE, null, ex);
        }
        currentTime++;
        MainInterface.showTime();
        if(currentTime%pct.T==0)pct.scheduleProcess(memory, deviceManager);
        MainInterface.showPCT();
        MainInterface.showLog();
        MainInterface.showDevice();
        MainInterface.showMemory();
        //System.out.println(currentTime);
    }
    }
    
}
